/* Vertex.java */
package graph;
import list.*;

/**
 * Vertex represents a Vertex object and a Dlist representing
 * the edges formed from this vertex to other vertices in this graph.
 */

public class Vertex {

	protected Object vertex;	
	protected DList edges;

	/**
	 * Constructor for the Vertex object.
	 * Creates a Vertex object with a vertex and empty DList.
	 * 
	 * @param vertex is the vertex that the object represents.
	 * 
	 * @return a new Vertex object with an empty DList 
	 * and vertex equal to the input vertex.
	 */
	public Vertex(Object vertex) {
		this.vertex = vertex;
		edges = new DList();
	}

	/**
	 * vertex() returns the object representing this Vertex.
	 * 
	 * @return the object representing this Vertex..
	 */
	public Object vertex() {
		return vertex;
	}

	/**
	 * edges() returns the DList representing the edges begining at this vertex.
	 * 
	 * @return DList representing the edges begining at this vertex.
	 */
	public DList edges() {
		return edges;
	}

	/**
	 * toString() returns the string representation of "this" Vertex (vertex.toString())
	 * 
	 * @return the string representation of "this" Vertex
	 */
	public String toString() {
		return vertex.toString();

	}
}
